package net.dl.ss.dao.ibatis;

import java.io.Serializable;
import java.sql.SQLException;
import java.util.List;

import net.dl.ss.dao.RoundDao;

public class RoundDaoIbatis extends CommonDaoIbatis implements RoundDao {

	protected String getTypeAlias() {
        return "Round";
    }

	/**
     * Retreive all rounds from specific table using category id as a criteria.
     *
     * @param id - category id
     * @return the list of rounds
     */
    @SuppressWarnings("unchecked")
    public <T> List<T> findByCategoryId(Serializable id) {
    	try {
            return IbatisUtil.queryList(getClient(), getTypeAlias()+".findByCategoryId", id);
        } catch(SQLException e) {
            throw new RuntimeException(e);
        }
    }
    
}
